package com.guaju.yueshangLife.viewmodel.login;

import android.app.Activity;
import android.content.Intent;
import android.databinding.BaseObservable;
import android.view.View;

import com.guaju.yueshangLife.activity.CodeLoginActivity;
import com.guaju.yueshangLife.activity.SetupPasswordActivity;

/**
 * Created by guaju on 2018/10/12.
 *
 */

public class RegistVM extends BaseObservable {


    public String phoneNum;
    public String verifyCode;
    private Intent intent;


//    public void nextStep(View v,String phoneNum, String verifyCode) {
//        if (!NotifyUtil.isPhoneNum(phoneNum)) {
//            ToastUtil.show("手机号格式不正确,请修改");
//        } else if (TextUtils.isEmpty(verifyCode)||verifyCode.length()!=4) {
//            ToastUtil.show("验证码错误,请检查");
//        } else {
//            //服务器校验
//            setupPassword(v);
//        }
//    }

//    public void nextStep(View v){
//        nextStep(v,phoneNum,verifyCode);
//    }

    public void toLogin(View v) {
        intent = new Intent(v.getContext(), CodeLoginActivity.class);
        v.getContext().startActivity(intent);
    }

    public void setupPassword(View v){
        intent = new Intent(v.getContext(), SetupPasswordActivity.class);
        v.getContext().startActivity(intent);
    }
    public static void goBack(View v){
        ((Activity)v.getContext()).finish();
    }
}
